<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>用户管理</title>
    <link href="<?php echo $_BASE_DIR ?>css_v1/style.css" rel="stylesheet" type="text/css"/>
    <link href="<?php echo $_BASE_DIR ?>css_v1/select.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="<?php echo $_BASE_DIR ?>js_v1/jquery.js"></script>
    <script type="text/javascript" src="<?php echo $_BASE_DIR ?>js_v1/jmw.js"></script>
    <script type="text/javascript" src="<?php echo $_BASE_DIR ?>js_v1/select-ui.min.js"></script>
    <script type="text/javascript" src="<?php echo $_BASE_DIR ?>js_v1/jquery.DatePicker.js"></script>

    <script type="text/javascript">
        $(document).ready(function (e) {
            $(".select1").uedSelect({
                width: 345
            });
            $(".select2").uedSelect({
                width: 167
            });
            $(".select3").uedSelect({
                width: 80
            });
        });
    </script>


</head>

<body>

<div class="place">
    <span>位置：</span>
    <ul class="placeul">
        <li><a href="<?php echo url("leftmenu/bottom") ?>">首页</a></li>
        <li><a href="#">用户管理</a></li>
    </ul>
</div>
<form method="post" action="<?php echo url("user/index") ?>">
    <div style="clear: both;height:35px;line-height:35px;margin-bottom:5px;">
        <div class="rightinfo">
            <!--------------------------------------->
            <ul class="seachforms" style="width:unset">

                <li>
                    <label>昵称：</label>
                    <input type="text" name="nickname" class="scinputjmw"
                           value="<?php echo isset($param['nickname']) ? $param['nickname'] : ''; ?>"/>
                    <input type="hidden" class="scinputjmw" name="_querymethod[nickname]" value="like">
                </li>
                <li>

                <li>
                    <label>手机号码：</label>
                    <input type="text" name="phone" class="scinputjmw"
                           value="<?php echo isset($param['phone']) ? $param['phone'] : ''; ?>"/>
                </li>
                <li><label>会员等级</label>
                    <div class="vocation">
                        <select name="viplevel_id" class="select3">
                            <option value="">请选择</option>
							<?php foreach ($viplevel_arr as $k => $v): ?>
                                <option value="<?php echo $k ?>" <?php if (isset($param['viplevel_id']) && $param['viplevel_id'] === $k) echo 'selected'; else echo ''; ?>><?php echo $v ?></option>
							<?php endforeach; ?>


                        </select>
                    </div>
                </li>
                <li><label>公司</label>
                    <div class="vocation">
                        <select name="company_id" class="select3">
                            <option value="">请选择</option>
				            <?php for ($i3=0;$i3<count($company);$i3++){ ?>
                                <option value="<?php echo $company[$i3]['id'] ?>" <?php if (isset($param['company_id']) && $param['company_id'] === $k) echo 'selected'; else echo ''; ?>><?php echo $company[$i3]['company_name'] ?></option>
				            <?php } ?>
                        </select>
                    </div>
                </li>

                <li><label>注册日期：</label><input name="addtime_timestart" id="addtime_timestart"
                                               value="<?php echo isset($param['addtime_timestart']) ? $param['addtime_timestart'] : ''; ?>"
                                               type="text" class="scinputjmw"/>---<input name="addtime_timeend"
                                                                                         id="addtime_timeend"
                                                                                         value="<?php echo isset($param['addtime_timeend']) ? $param['addtime_timeend'] : ''; ?>"
                                                                                         type="text"
                                                                                         class="scinputjmw"/></li>
                <li><label>&nbsp;</label><input type="submit" class="scbtn" value="查询" style="width:60px;"/></li>
                <li><a class="scbtn" id="export-btn" style="width:60px; padding: 10px">导出查询结果</a></li>
            </ul>
        </div>
    </div>


</form>

<div class="tools">

    <ul class="toolbar">

        <!-- <li ><a href="#" onclick="editindex('user_id','<?php echo url("user/add") ?>/id/')"><span><img src="<?php echo $_BASE_DIR ?>images_v1/t02.png" /></span>修改</a></li>
        
        <li class="click"><a href="#" onclick="isDel('user_id','<?php echo url("user/del") ?>','ids[]')"><span><img src="<?php echo $_BASE_DIR ?>images_v1/t03.png" /></span>删除</a></li> -->

    </ul>


</div>


<script>
    $('#created_timestart').datePicker({followOffset: [0, 24]});
    $('#created_timeend').datePicker({followOffset: [0, 24]});
</script>

<form action="" method="post" name="form">

    <table class="tablelist">

        <thead>
        <tr>
            <th width="5%"><input type="checkbox" value="on" name="chkall" onClick="CheckAll(this.form)"/></th>
            <th width="5%">ID</th>
            <th width="8%">昵称</th>
            <th width="8%">会员等级</th>
            <th width="10%">手机号码</th>
            <th width="7%">会员到期时间</th>
            <th width="5%">累计消费金额</th>
            <th width="5%">累计佣金</th>
            <th width="12%">注册时间</th>
            <th width="10%">操作</th>
        </tr>
        </thead>
        <tbody>
		<?php foreach ($item as $k => $v): ?>
            <tr>
                <td><input name="user_id" id="user_id" type="checkbox" value="<?php echo $v->id ?>"/></td>
                <td><?php echo h($v->id) ?></td>
                <td><?php echo h($v->nickname) ?></td>
                <td><?php echo h(viplevel::getvipname($v->viplevel_id)); ?></td>
                <td><?php echo h($v->phone) ?></td>
                <td><?php echo h($v->due_time == 0 ? '' : date("Y-m-d", $v->due_time)); ?></td>

                <td><?php echo $v->total_consume ?></td>
                <td><?php echo $v->commission + $v->used_commission + $v->wait_commission ?></td>
                <td><?php echo date('Y-m-d H:i:s', $v->addtime); ?></td>
                <td>
                    <a href="<?php echo url('user/editparent', array('user_id' => $v->id)) ?>">修改推荐人</a>
                    <a href="<?php echo url('user/add', array('id' => $v->id)) ?>">编辑</a>
                    <a href="<?php echo url('user/learninfo', array('user_id' => $v->id)) ?>">学习情况</a>
                </td>
            </tr>
		<?php endforeach; ?>

        </tbody>
    </table>

</form>

<?php echo Q::control('pagination', 'pagination', array('url_args' => $param, 'pagination' => $pagination, 'show_count' => 1)) ?>
</div>

<script type="text/javascript">
    $('.tablelist tbody tr:odd').addClass('odd');

    $("#export-btn").click(function(){
        var url ="<?php echo url("user/export")?>";
        location.href=url;
    })
</script>
</body>
<iframe id="excel" name="excel" width="0" height="0"></iframe>
</html>


